home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++,comp.lang.eiffel,comp.object,comp.arch
- Path: netcom.com!jgk
- From: Joe Keane <jgk@netcom.com>
- Subject: Re: Real OO
- Message-ID: <jgkDpzFnD.KL7@netcom.com>
- Summary: It's optimization.
- Keywords: function
- Sender: jgk@netcom16.netcom.com
- Organization: none
- References: <65lDeVZF3RB@herold.franken.de> <DpBw9w.Mru@assip.csasyd.oz> <4kbl7r$1i8@gaia.ns.utk.edu> <4ke84h$iiv@watnews1.watson.ibm.com>
- Date: Wed, 17 Apr 1996 01:18:49 GMT
-
- In article <4kbl7r$1i8@gaia.ns.utk.edu>
- Matt Kennel <mbk@caffeine.engr.utk.edu> writes:
- >My experience with Sather numerical classes is that the cost of
- >indirect calls is not the actual indirection, but the lost
- >opportunities for inlining.
-
- In article <4ke84h$iiv@watnews1.watson.ibm.com>
- Norman H. Cohen <ncohen@watson.ibm.com> writes:
- >Plus the opportunities that arise from cross-procedural analysis, for
- >compilers that perform such analysis for statically bound subprograms.
- >
- >(But remember, in counting the cost of the actual indirection, to count
- >machine cycles rather than instruction path length. Indirect function
- >calls can cause expensive I-cache misses on some architectures.)
-
- Ding ding ding! People too often concentrate on the number of
- instructions to just do the function call, either static or virtual.
-
- In my experience that's not the thing; rather it's that when you inline
- a function the compiler has much more oppurtunity for optimization.
- This comes from a variety of reasons, and i'm convinced that in real
- situations this is more important than a couple cycles to jump.
-
- If the function being called isn't known at compile time, the compiler
- must assume the worst, even though it's quite likely that the function
- will turn out to be something very simple.
-
- --
- Joe Keane, professional programmer
-